//
//  oldMomentCommentTableViewCell.m
//  laonianbang
//
//  Created by 勇拓 李 on 18/4/2.
//  Copyright © 2018年 zaiyou. All rights reserved.
//

#import "oldMomentCommentTableViewCell.h"
#import "UIImageView+oldImageView.h"

@interface oldMomentCommentTableViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *img_avatar;
@property (weak, nonatomic) IBOutlet UILabel *label_name;
@property (weak, nonatomic) IBOutlet UILabel *label_time;
@property (weak, nonatomic) IBOutlet UILabel *label_content;

@end

@implementation oldMomentCommentTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    _img_avatar.layer.cornerRadius = 35/2;
}

- (void)setComment:(oldComment *)comment
{
    _comment = comment;
    [_img_avatar showHeadImg:comment.replyUserInfo.avatar];
    _label_name.text = comment.replyUserInfo.uname;
    _label_time.text = comment.created_at;
    if (comment.mentionedUserInfo) {
        _label_content.text = [NSString stringWithFormat:@"回复%@：%@", comment.mentionedUserInfo.uname, comment.content];
    }
    else
    {
        _label_content.text = comment.content;
    }
}

- (void)setActivity:(oldActivityComment *)activity
{
    [_img_avatar showHeadImg:activity.userInfo.avatar];
    _label_name.text = activity.userInfo.uname;
    _label_time.text = activity.created_at;
    _label_content.text = activity.content;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

@end
